<%-- 
    Document   : CategorySetting
    Created on : 2011-10-15, 17:15:34
    Author     : administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Category Setting</title>
        <link rel="stylesheet" type="text/css" href="resource/main_page/main-page.css" />
        <script type="text/javascript" language="JavaScript" src="resource/main_page/main_page.js"></script>
        <script type="text/javascript" language="JavaScript" src="resource/view_threads/thread.js"></script>
        <link rel="stylesheet" type="text/css" href="resource/cupertino/jquery-ui-1.8.16.cupertino.css"/>
        <script type="text/javascript" src="resource/jquery-1.6.2.min.js"></script>
        <script type="text/javascript" src="resource/jquery-ui-1.8.16.custom.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $("#dialog").dialog({
                modal: true,
                autoOpen: false,
                height: 150,
                width: 500
                });
                $("button").button();

            });
            function initialize(info)
            {
                if(info == 1)
                    alert("deleted successfully");
                if(info == 2)
                    alert("updated successfully");
                if(info == 3)
                    alert("invalid user,please try again")
            }
            function show(){
	        var name = "add moderator";
	        $("#dialog").dialog("option","title",name);
	        $("#dialog").dialog("open");
            }
        </script>
    </head><s:if test="type == 1">
        <body onkeydown="try{keyCodes(event);}catch(e){}" onload=initialize(1)>
        </s:if>
        <s:elseif test="type == 2">
        <body onkeydown="try{keyCodes(event);}catch(e){}" onload=initialize(2)>
        </s:elseif>
        <s:elseif test="type == 2">
        <body onkeydown="try{keyCodes(event);}catch(e){}" onload=initialize(3)>
        </s:elseif>
        <s:else>
            <body onkeydown="try{keyCodes(event);}catch(e){}" >
        </s:else>
        <div class="main-wrap">
            <div id="user-nav">
                <%@ include file="ForumHead.jsp" %>
            </div>
            <div id="main">
                <style type="text/css">
                    .t table tr.tr2 td.f{width:22%;}
                    .t table tr.tr2 td.e{width:10em;}
                </style>
                <div class="forum-info cc gray">
                    <div class="fr">welcome,${session.user.unikey}|<a href="LoginAction_out"><b>Logout</b></a></div>
                </div>
                <style type="text/css">
                    .tr3 td,.tr3 th{padding:4px 8px;line-height:1.3;}
                    .tr_rep{padding:0;color:#999;}
                    .tr_rep span{color:#ff6600;}
                    .threadlist{padding-left:10px;bottom:-1px;position:absolute;}
                    .threadlist a{display:block;float:left;padding:0 9px;border-bottom:0;line-height:25px;height:25px;}
                    .threadlist .bta{height:20px;line-height:20px;border:1px solid #a6cbe7;margin-left:1em;}
                    .threadlist .current,.threadlist .active{background:#ffffff;border:1px solid #c5d8e8;padding:0 8px;border-bottom:0;color:#3d75ac;}
                    .t-cate-s{border-top:1px solid #d5e6ed;margin-top:10px;}
                    .t-cate-s .threadlist2{padding:5px 10px;line-height:25px;}
                    .t-cate-s .threadlist2 a{color:#3366cc;float:left;white-space:nowrap;padding:0 10px;}
                    .t-cate-s .threadlist2 .current{ font-weight:700;}
                    .t-cate-s .p10 span{float:left;margin:0 20px 10px 0; height:25px; white-space:nowrap;}
                    .t-cate-s .p10 input{ vertical-align:middle;}
                    .t-cate-s .p10 .btn{margin:0 5px;}
                    .t_search{border:1px solid #a6cbe7;background:#ffffff;margin-left:5px;height:18px;overflow:hidden;}
                    .t_s_ip{border:1px solid #fff;padding:1px 2px 0;float:left;height:15px; font:12px/14px Arial;background:#fff; width:85px;}
                    .t_s_btn{float:left;background:#f3f9fb url(resource/view_threads/t_search.png) center -1px no-repeat;border:1px solid #fff;border-left:1px solid #d5e6ed; cursor:pointer;width:25px;height:18px;overflow:hidden;}
                    .t_search input::-moz-focus-inner{border-color:transparent!important;}
                </style>
                <div id="breadCrumb" class="cc">
                    <s:url id="url_view" value="ThreadAction_listThreads">
                        <s:param name="categoryID" value="category.categoryId"/>
                        <s:param name="categoryName" value="category.categoryName"/></s:url>
                    <img style="cursor:pointer" id="td_cate" src="resource/view_threads/home.gif" align="absmiddle" /> <a href="main.jsp" title="ELEC_Forum">ELEC Forum</a> &raquo; <s:a href="%{url_view}">${category.categoryName}</s:a>
                </div>
                <div class="t3 cc">
                    <span class="fr" style="margin-left:.5em"><button onclick="show()">new moderator</button></span>

                </div>
                <div class="c"></div>
                <div class="c" id="c"></div>
                <div class="t z" style="margin:auto">
                    <table cellspacing="0" cellpadding="0" width="100%" id="ajaxtable">
                        <tr><th class="h" colspan="6">
                                <div class="pr cc" style="height:30px;">
                                    <div class="fn fl threadlist">
                                        <a id="thread_type_all" href="">moderators</a>
                                    </div>
                                </div>
                                <script language="javascript">
                                    setCurrent('thread_type_all','thread_type_all','current');
                                </script>
                            </th>
                        </tr>
                        <tbody style="table-layout:fixed;">

                        <script language="JavaScript">
                            var orderThreadsClass = {
                                orderThreads : function(orderway){
                                    var orderway = orderway || 'lastpost';
                                    var form = document.createElement("form");
                                    form.action = "thread.php?fid=4&page=1&";
                                    form.method = "post";
                                    var h_type = this.createInput("hidden","type","");
                                    var h_search = this.createInput("hidden","search","1000");
                                    var h_special = this.createInput("hidden","special","");
                                    var h_orderway = this.createInput("hidden","orderway",orderway);
                                    var h_asc = this.createInput("hidden","asc","DESC");
                                    form.appendChild(h_type);
                                    form.appendChild(h_search);
                                    form.appendChild(h_special);
                                    form.appendChild(h_orderway);
                                    form.appendChild(h_asc);
                                    document.body.appendChild(form);
                                    setTimeout(function(){/*ie6*/
                                        form.submit();
                                    },0);
                                    return false;
                                },
                                createInput : function(type,name,value){
                                    var hidden = document.createElement("input");
                                    hidden.type = type;
                                    hidden.name = name;
                                    hidden.value = value;//¡ý
                                    return hidden;
                                }
                            }
                            function orderThreads(orderway){
                                orderThreadsClass.orderThreads(orderway);
                            }
                        </script>
                        <td style="width:120px;" class="y-style">name(unikey)</td>
                        <td style="width:80px" class="tal y-style">operation</td>



                        <tr class="tr2"><td colspan="6" class="tac" style="border-top:0"></td></tr>
                            <s:iterator value="category.users">
                                <s:url id="url_delete" value="CategoryActionAdmin_delete">
                                    <s:param name="uni" value="unikey"/>
                                    <s:param name="categoryID" value="category.categoryId"/>
                                </s:url>
                            
                            <tr align="center" class="tr3 t_one">
                                
                                <td class="tal" id="td_4">
                                    <s:property value="unikey"/>

                                </td>
                                <td class="tal y-style"><s:a href="%{url_delete}">delete</s:a>
                                </td>
                            </tr>
                                
                            </s:iterator>
                        <tr><td colspan="6" class="f_one" style="height:8px"></td></tr>
                        </tbody>
                    </table></div>
            </div>
        </div>
    </body>
</html>
<div id="dialog"><form action ="CategoryActionAdmin_create?categoryID=${category.categoryId}" method ="post">unikey:<input name="uni" size="8"/><br>
    <div align="center">
        <button type="submit">Save</button>
    </div></form></div>
<script language="JavaScript" src="resource/main_page/fast_access.js"></script>
<%@ include file="ForumFoot.jsp" %>


